function init()
{
	var time = new Date().getTime();
	var signature = hex_md5("appkey=a063bae8671dc9c2c3061d63&timestamp=" + 
		time + "&random_str=022cd9fd995849b58b3ef0e943421ed9&key=e5d5124b67e1c33c0387a745");

	JIM.init({
		"appkey": "a063bae8671dc9c2c3061d63",
		"random_str": "022cd9fd995849b58b3ef0e943421ed9",
		"signature": signature,
		"timestamp": time,
	}).onSuccess(function(data) {
		console.log('success:' + JSON.stringify(data));
	}).onFail(function(data){
		alert("抱歉,初始化失败");
		console.log("fail")})
}


function login(username,password)
{
	JIM.login(
	{
		"username":$("#username").val(),
		"password":$("#password").val()
	}).onSuccess(function(){
		//alert("登录成功");
		console.log("登录成功");
	}).onFail(function()
	{
		alert("登录失败");
		console.log("Jmessage login failed")
	})
}
